package controllers

import (
	// "encoding/json"

	"GameServer/Game/player"

	"github.com/gin-gonic/gin"
)

type Goods struct {
	Tid int64 `json:"tid"`
	Num int64 `json:"num"`
}

type SMail struct {
	Uids    []string `json:"uids"`
	Type    int64    `json:"type"`
	Title   string   `json:"title"`
	Content string   `json:"content"`
	Res     string   `json:"res"`
}

// @Summary 发送邮件
// @Produce   json
// @ParamType body
// @Success 200 {string} json "{"code":0,"data":{},"msg":"ok"}"
// @Router /mail [post]
func SendMail(c *gin.Context) {
	var smail SMail
	if err := c.ShouldBindJSON(&smail); err != nil {
		handleErr(c, err.Error())
		return
	}

	player.SendMails(smail.Type, smail.Uids, smail.Title, smail.Content, smail.Res)
	handleOk(c, nil)
}
